/**
 * @param {string[]} strs
 * @return {string[][]}
 */
// 字母以为分组
 var groupAnagrams = function(strs) {
    var h = new Map, prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101]
       for(var i = 0; i < strs.length; i++) {
           for(var j = 0, sum = 1; j < strs[i].length; j++)
               sum *= prime[strs[i].charCodeAt(j) - 97]
           h.has(sum) ? h.get(sum).push(strs[i]) : h.set(sum, [strs[i]])
       }
       return Array.from(h.values())
   };